package Collestions_demo;

import java.util.ArrayList;
import java.util.Collection;
import java.util.List;

public class Collection_3 {
    public static void main(String[] args) {
        Point1 p = new Point1(1,2);
        Collection<Point1> c = new ArrayList<>();
        c.add(p);
        System.out.println(c);
        p.setX(4);
        System.out.println(c);
        p.setY(55);
        System.out.println(c);
        for (Point1 s : c){
            System.out.println(s);
        }


        List<Point1> p2 = new ArrayList<>(c);
        p2.add(new Point1(2,2));
        System.out.println(p2);
    }
}
